package com.study.manage.dal;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;

import com.study.manage.domain.UserRole;
import com.study.manage.domain.enumm.LiveDieState;
import com.study.manage.domain.enumm.UserRoleType;

public interface UserRoleRepository extends PagingAndSortingRepository<UserRole, Long> {

    @Query("select t.type from UserRole t where t.userId=:userId and t.state=:state")
    List<UserRoleType> findTypeByUserIdAndState(@Param("userId") Long userId,
            @Param("state") LiveDieState state);

}
